allow returning partial information
authorMatthias Clasen <matthiasc@src.gnome.org>
Fri, 2 Jun 2006 17:56:37 +0000 (17:56 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 2 Jun 2006 17:56:37 +0000 (17:56 +0000)
ChangeLog
ChangeLog.pre-2-10
gtk/gtkstatusicon.c

index 9d7941b1b942cae4517e44de2d8c7ba335c42076..e3fe7ed0c2f66dd7d7028f011b341ac7a0be1a17 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-06-02  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkstatusicon.c (gtk_status_icon_get_geometry): Allow
+       to return partial information.  (#343625, Christian Persch)
+
        * gtk/gtkwindow.c (gtk_window_key_release_event): Chain up
        to key_release, not to key_press.  (#343677, Tommi Komulainen)
 
index 9d7941b1b942cae4517e44de2d8c7ba335c42076..e3fe7ed0c2f66dd7d7028f011b341ac7a0be1a17 100644 (file)
@@ -1,5 +1,8 @@
 2006-06-02  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkstatusicon.c (gtk_status_icon_get_geometry): Allow
+       to return partial information.  (#343625, Christian Persch)
+
        * gtk/gtkwindow.c (gtk_window_key_release_event): Chain up
        to key_release, not to key_press.  (#343677, Tommi Komulainen)
 
index 61a62fc000c9fdc37d3757d31c721551b063861a..27a56511cf74144f5e9d5f06d86a718ae18cf36c 100755 (executable)
@@ -1634,12 +1634,14 @@ gtk_status_icon_position_menu (GtkMenu  *menu,
 /**
  * gtk_status_icon_get_geometry:
  * @status_icon: a #GtkStatusIcon
- * @screen: return location for the screen 
- * @area: return location for the area occupied by the status icon
+ * @screen: return location for the screen, or %NULL if the
+ *          information is not needed 
+ * @area: return location for the area occupied by the status 
+ *        icon, or %NULL
  * @orientation: return location for the orientation of the panel 
- *    in which the status icon is embedded. A panel at the top or
- *    bottom of the screen is horizontal, a panel at the left or
- *    right is vertical.
+ *    in which the status icon is embedded, or %NULL. A panel 
+ *    at the top or bottom of the screen is horizontal, a panel 
+ *    at the left or right is vertical.
  *
  * Obtains information about the location of the status icon
  * on screen. This information can be used to e.g. position 
@@ -1666,18 +1668,25 @@ gtk_status_icon_get_geometry (GtkStatusIcon    *status_icon,
   GtkStatusIconPrivate *priv;
   gint x, y;
 
-  g_return_if_fail (GTK_IS_STATUS_ICON (status_icon));
+  g_return_val_if_fail (GTK_IS_STATUS_ICON (status_icon), FALSE);
 
   priv = status_icon->priv;
   widget = priv->tray_icon;
 
-  *screen = gtk_widget_get_screen (widget);
-  gdk_window_get_origin (widget->window, &x, &y);
-  area->x = x;
-  area->y = y;
-  area->width = widget->allocation.width;
-  area->height = widget->allocation.height;
-  *orientation = _gtk_tray_icon_get_orientation (GTK_TRAY_ICON (widget));
+  if (screen)
+    *screen = gtk_widget_get_screen (widget);
+
+  if (area)
+    {
+      gdk_window_get_origin (widget->window, &x, &y);
+      area->x = x;
+      area->y = y;
+      area->width = widget->allocation.width;
+      area->height = widget->allocation.height;
+    }
+
+  if (orientation)
+    *orientation = _gtk_tray_icon_get_orientation (GTK_TRAY_ICON (widget));
 
   return TRUE;
 #else